package research_aggregator;


import java.sql.*;

import com.mysql.jdbc.Connection;

public class DataBase {
	public Connection connection;
	public Statement statement;
	public PreparedStatement preparedStatement;
	public ResultSet resultSet;
	private String location;
	private String database;
	private String username;
	private String password;
	
	public DataBase(String location, String database, String username, String password) {
		this.location = location;
		this.database = database;
		this.username = username;
		this.password = password;		
	}
	
	
	public void connect () throws SQLException
	{
		connection = (Connection) DriverManager.getConnection("jdbc:mysql://" + location + "/" 
				+ database + "?" + "user=" + username + "&password=" + password);	
	}
	
	public void close() throws SQLException{
		connection.close();
	}
	
}
